package com.frank.java8.readFile;

import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * @author 小石潭记
 * @date 2020/11/23 10:25
 * @Description: ${todo}
 */
public class FileTest {

    public static void main(String[] args) throws Exception{
        /*String s = new String(Files.readAllBytes(Paths.get("src","main", "resources", "Main.txt")));
        System.out.println(s);*/

        /*Path path = Paths.get("");
        Path absolutePath = path.toAbsolutePath();
        System.out.println(absolutePath.toString());*/
        String property = System.getProperty("user.dir");
        System.out.println(property);
        String a = property + "/src/main/resources/script/Test.txt";
        System.out.println(a);
        String b = "D:\\IdeaCode\\newcode\\springboot-learn\\src\\main\\resources\\script\\Test.txt";
        System.out.println(b);
        String s = new String(Files.readAllBytes(Paths.get(System.getProperty("user.dir"), "/src/main/resources/script/Test.txt")));
        System.out.println(s);


    }

}
